The present invention relates to semiconductor devices and particularly relates to, for example, a semiconductor device that includes a data retention circuit that retains input data in synchronization with a clock signal.
In recent years, in the field of semiconductor devices, functional safety that safety of a system that the semiconductor device is to be loaded is ensured even when a fault has occurred has been sought for. As one example of the functional safety, a clock safety function of ensuring soundness of the clock signal used in the semiconductor device is given. In the clock safety function, it is requested to monitor a state of the clock signal. Accordingly, one example of a technology of monitoring the state of the clock signal is disclosed in Japanese Unexamined Patent Application No. H09-292928.
A clock signal source monitoring device described in Japanese Unexamined Patent Application No. H09-292928 includes a plurality of clock signal sources and a plurality of counters and gives the clock signals from the first to third clock signal sources to the first to third counters respectively as clear signals. In addition, in the clock signal source monitoring device described in Japanese Unexamined Patent Application No. H09-292928, the clock signal from the first clock signal source is given to the second and third counters as a count input and the clock signal from the second clock signal source is given to the first counter as the count input. Accordingly, in the clock signal source monitoring device described in Japanese Unexamined Patent Application No. H09-292928, when any one of the clock signal sources has gone wrong, a count value is counted up to a set value and therefore an alarm signal is given off. In addition, immediately after a power source has been turned on, the count value is set to a value indicative of an alarm state with a preset signal from a count value setting unit. Since the alarm signal is not lost when the power source is turned on even when the plurality of clock signal sources have gone wrong by doing so, the fault is detected.